/**
 * 
 */
package com.fly.sms.adapter;

import java.util.List;
import java.util.Map;

import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.fly.sms.CommonActivity;
import com.fly.sms.R;

public class CashPayListAdapter extends IAdapter {
	private List<Map<String, Object>> list = null;

	public CashPayListAdapter(CommonActivity context,
			List<Map<String, Object>> list) {
		super(context);
		this.list = list;
	}

	public int getCount() {
		return list.size();
	}

	public Object getItem(int position) {
		return position;
	}

	public long getItemId(int position) {
		return position;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		if (convertView == null) {
			convertView = context.getView(R.layout.cashpayitem);
		}
		Map<String, Object> map = list.get(position);
		TextView CreateTime = (TextView) convertView
				.findViewById(R.id.CreateTime);
		TextView PayAmount = (TextView) convertView
				.findViewById(R.id.PayAmount);
		TextView CreditsAmount = (TextView) convertView
				.findViewById(R.id.CreditsAmount);
		TextView Remark = (TextView) convertView.findViewById(R.id.Remark);

		CreateTime.setText(map.get("CreateTime").toString());
		PayAmount.setText(map.get("PayAmount").toString());
		CreditsAmount.setText(map.get("CreditsAmount").toString());
		Remark.setText(map.get("Remark").toString());
		return convertView;
	}
}
